package com.zhengx.androidarchbasicsample;

import android.content.Context;
import android.content.res.Configuration;

import com.zhengx.baselib.base.BaseApplication;
import com.zhengx.baselib.ModulesInitializer;


/**
 * name：MyApp4J
 * class: describe
 * author: zhengx
 * create_time: 2019/1/18
 */

public class MyApp4J extends BaseApplication{

    private static String[] MODULESLIST = new String[] {"com.zhengx.moduletest.ModuleApplicationFake"};

    private ModulesInitializer modulesInitializer;

    @Override
    public void onCreate() {
        super.onCreate();
        modulesInitializer.onCreate();
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
        modulesInitializer.onTerminate();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        modulesInitializer.onConfigurationChanged(newConfig);
    }

    @Override
    public void onLowMemory() {
        super.onLowMemory();
        modulesInitializer.onLowMemory();
    }

    @Override
    public void onTrimMemory(int level) {
        super.onTrimMemory(level);
        modulesInitializer.onTrimMemory(level);
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        //multidex

        modulesInitializer = new ModulesInitializer(MODULESLIST, this);
    }
}
